<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .map{
            position: relative;
            width: 100px;
            height: 100px;
            background-color: pink;
            margin: 100px auto;
        }
        #dotted{
            width: 8px;
            height: 8px;
            background-color: blue;
            position: absolute;
            top: 50%;
            left: 50%;
            margin-top: -4px;
            margin-left: -4px;
            border-radius: 50%;
            z-index: 999;
            
        }
         /* #dotted:hover{
            animation: a 0.3s linear infinite;
         } */
        @keyframes a{
            0%{
                transform: scale(1);
            }
            50%{
                transform: scale(1.5);
            }
            100%{
                transform: scale(1);
            }
        }


        .pulse1,
        .pulse2,
        .pulse3
        {
            box-shadow: 0 0 10px 2px red;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
            border-radius: 50%;
            animation: pulse 1s linear infinite;
        }
        .pulse2{
            animation-delay: 1.5s;
        }
        .pulse3{
            animation-delay: 2s;
        }
        #city{
            display: none;
        }
        @keyframes pulse{
            0%{
                width: 0;
                height: 0;
            }
            70%{
                /* transform: scale(5); 不要用scale 因为它会让 阴影变大 */
                width: 40px;
                height: 40px;
                opacity: 1;
            }
            100%{
                width: 70px;
                height: 70px;
                opacity: 0;
            }
        }
    </style>
</head>
<body>
    <div class="map">
        <div id="dotted"></div>
        <div id="city">
            <div class="pulse1"></div>
            <div class="pulse2"></div>
            <div class="pulse3"></div>
        </div>
    </div>
    <script>
        var dotted = document.getElementById('dotted');
        var pulse1 = document.getElementById('city');
        // dotted.onclick=function(){
        //     city.style.display='none'
        // }
        // dotted.onmouseout=function(){
        //     city.style.display='none'
        // }
        // dotted.onmouseover=function(){
        //     city.style.display='block';
        // }
        dotted.onmouseover=function(){
            dotted.style.animation= 'a 0.3s linear infinite';
        }
        dotted.onclick=function(){
            city.style.display='block';
        }
    </script>
</body>
</html>